import java.util.Scanner;

public class StringDemo2 {
    public static void main(String[] args) {
        String name="Anne";
        String password = "123456";

        for (int i = 0; i < 3; i++) {
            System.out.println("Enter your name:");
            Scanner sc = new Scanner(System.in);
            String inputname = sc.nextLine();

            System.out.println("Enter your password:");
            Scanner sc1 = new Scanner(System.in);
            String inputpassword = sc.nextLine();

            if(inputname.equals(name) && inputpassword.equals(password)){
                System.out.println("Login Success!");
            }else{
                if(i==2){
                    System.out.println("You have tried 3 times, the account is locked!");
                }else {
                    System.out.println("Name or Password is wrong,please try again: ");
                }
            }
        }


    }
}
